/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.app.course.exercise.record.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.app.course.exercise.record.entity.TcourseExerciseRecord;
import com.jeesite.modules.app.course.exercise.record.dao.TcourseExerciseRecordDao;
import com.jeesite.modules.file.utils.FileUploadUtils;

/**
 * 课程练习记录Service
 * @author zpp
 * @version 2020-02-17
 */
@Service
@Transactional(readOnly=true)
public class TcourseExerciseRecordService extends CrudService<TcourseExerciseRecordDao, TcourseExerciseRecord> {
	
	/**
	 * 获取单条数据
	 * @param tcourseExerciseRecord
	 * @return
	 */
	@Override
	public TcourseExerciseRecord get(TcourseExerciseRecord tcourseExerciseRecord) {
		return super.get(tcourseExerciseRecord);
	}
	
	/**
	 * 查询分页数据
	 * @param tcourseExerciseRecord 查询条件
	 * @param tcourseExerciseRecord.page 分页对象
	 * @return
	 */
	@Override
	public Page<TcourseExerciseRecord> findPage(TcourseExerciseRecord tcourseExerciseRecord) {
		return super.findPage(tcourseExerciseRecord);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param tcourseExerciseRecord
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(TcourseExerciseRecord tcourseExerciseRecord) {
		super.save(tcourseExerciseRecord);
		// 保存上传图片
		FileUploadUtils.saveFileUpload(tcourseExerciseRecord.getId(), "tcourseExerciseRecord_image");
		// 保存上传附件
		FileUploadUtils.saveFileUpload(tcourseExerciseRecord.getId(), "tcourseExerciseRecord_file");
	}
	
	/**
	 * 更新状态
	 * @param tcourseExerciseRecord
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(TcourseExerciseRecord tcourseExerciseRecord) {
		super.updateStatus(tcourseExerciseRecord);
	}
	
	/**
	 * 删除数据
	 * @param tcourseExerciseRecord
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(TcourseExerciseRecord tcourseExerciseRecord) {
		super.delete(tcourseExerciseRecord);
	}
	
}